<template>
  <div class="jlf-caselist">
    <ul class="jlf-module-list" :style="width? {width: width+'px'} : {}" v-if="caseList.length > 0" >
      <li class="jlf-module-list-item jlf-caselist__item" v-for="(v, i) in caseList" :key="i" @click="onClick(v)">
          <div class="jlf-caselist__item__left">
            <img v-if="v.Image" :src="v.Image ? v.Image : v.Src" />
            <img v-else src="https://s3.bmp.ovh/imgs/2021/10/10106173b0d84f59.png" />
          </div>
          <div class="jlf-caselist__item__right">
            <p class="jlf-caselist__item__number">{{ v.Code }}</p>
            <p class="jlf-caselist__item__address">{{ v.Address }}</p>
            <p class="jlf-caselist__item__time">{{ v.ReportTime }}</p>
            <div class="jlf-caselist__item__star" v-if="v.Score">
              <star :score="v.Score"></star>
            </div>
            <slot></slot>
            <div class="jlf-caselist__item__desc" v-if="v.CurrentStateName">
              <p class="jlf-caselist__item__desc__state" v-if="v.CurrentStateName == '待受理'">
                {{ v.CurrentStateName }}
              </p>
              <p class="jlf-caselist__item__desc__state" v-if="v.CurrentStateName == '未受理'">
                {{ v.CurrentStateName }}
              </p>
              <p class="jlf-caselist__item__desc__state" v-if="v.CurrentStateName == '已受理'">
                {{ v.CurrentStateName }}
              </p>
              <p class="jlf-caselist__item__desc__state" v-if="v.CurrentStateName == '不受理'">
                {{ v.CurrentStateName }}
              </p>
            </div>
          </div>
        
      </li>
    </ul>
    <div class="jlf-caselist__noData" v-else>
      <img  class="jlf-caselist__noData_img" src="../../images/noData.png" alt="">
      <p class="jlf-caselist__noData_text">暂无数据</p>
    </div>
  </div>
</template>

<script>
import Star from '../star'
export default {
  name: "MCaseList",
  components: { Star },
  props: {
    width: {
      type: Number,
      default: 0
    },
    caseList: {
      type: Array,
      default: function () {
        return [];
      },
    },
  },
  data() {
    return {
      isData: false
    };
  },
  computed: {},
  methods: {
    onClick(item) {
      var that = this
      that.$emit('onClick',item)
    },
  },
};
</script>

<style scoped>

</style>
